<?php
    function getmessagecode($id){
        $CI =& get_instance();
        $messagearr = $CI->applicationsetup->getmessagecodebyid($id);
        
        return $messagearr;
        
    }

    function getshortmessagecode($id){
        $CI =& get_instance();
        $messagearr = $CI->applicationsetup->getmessagecodebyid($id);

        return $messagearr[0]['MessageCodeShort'];
    }

    function getlongmessagecode($id){
        $CI =& get_instance();
        $messagearr = $CI->applicationsetup->getmessagecodebyid($id);

        return $messagearr[0]['MessageCodeLong'];
    }
    
    function show_message($messagecodeArr){
		if($messagecodeArr['flashmessage'][0]['MessageCodeTypeId'] == 2){
			echo "<div class='flash-message'>".
                                             "<table width='300px'>".
                                                "<tr>".
                                                    "<td width='50px'>".
                                                        "<img src='".base_url()."images/alert.png' width='35' height='35'>".
                                                    "</td>".
                                                    "<td valign='middle' class='validation-advice'><br />".$messagecodeArr['flashmessage'][0]['MessageCodeShort'].
                                                    "</td>".
                                                "</tr>".
                                             "</table>".
                                             "</div>";
		}else if($messagecodeArr['flashmessage'][0]['MessageCodeTypeId'] == 3){
			echo "<div class='flash-message2'>".
                                             "<table width='300px'>".
                                                "<tr>".
                                                    "<td width='50px'>".
                                                        "<img src='".base_url()."images/warning2.png' width='35' height='35'>".
                                                    "</td>".
                                                    "<td valign='middle' class='validation-advice2'>".$messagecodeArr['flashmessage'][0]['MessageCodeLong'].
                                                    "</td>".
                                                "</tr>".
                                             "</table>".
                                             "</div>";
		}
	}

/* End of file messagecode_helper.php */
/* Location: ./application/helpers/messagecode_helper.php */
